Function.prototype.my_bind = function(context, ...args1) {
	if (typeof this !== 'function') {
		throw new TypeError('error')
	}
	context = context || window
	const _this = this
	const help = function() {}
	if (this.prototype) {
		help.prototype = this.prototype
	}
	const bound = function(...args2) {
		return _this.call(
			this instanceof help ? this : context, ...args1, ...args2)
	}
	bound.prototype = new help()
	return bound
}

Function.prototype.bind = function(context, ...args1) {
	let fn = this;
	return function(...args2) {
		return fn.apply(context, [...args1, ...args2]);
	}
};

// 测试
function greet(name, age) {
	console.log(`你好，我的名字是${name}，我${age}岁了。`);
}

let person = {
	name: 'John',
	age: 30
};

let boundGreet = greet.bind(person, 'Alice');

boundGreet(25); // 输出：你好，我的名字是Alice，我25岁了。